﻿@model Kelper.Domain.Models.Recipe
@{
    ViewBag.Title = "Kelper - " + Model.Name;
    ViewBag.Keywords = Model.Name + ", " + Model.IngredientsCSV;
}
 
<div class="recipe">
    <div class="recipe-header">
        <h1>@Model.NiceName</h1>
    </div>
    <div class="recipe-category">
        Posted in <strong>@Html.ActionLink(Model.Category.Name, "view", "category", new { name = Model.Category.Name }, null)</strong>
    </div>
    <div class="recipe-content">
        <div class="recipe-created">
            @Model.Created.ToLocalTime()
        </div>
        <div class="recipe-author">
            @Html.ActionLink(Model.Author.Username, "visit", "user", new { id = @Model.Author.Username }, null)
        </div>
        <div class="recipe-ingredients">
            Ingredients in this recipe:
            <div>
                @foreach (var i in Model.Ingredients) {
                    <span>@Html.ActionLink(i.Name, "view", "ingredient", new { i.Name }, null)</span>
                }
            </div>
        </div>
        <div class="recipe-text">
            @if (ViewBag.HasImage)
            {
                <div class="recipe-image">
                    <img src="@Url.Action("Image", new { Model.ID })" alt="image" />
                </div>
            }
            @Html.Linebreaks(Model.Text)
        </div>
    </div>
</div>